package fr.appliClient.server.dao;

import org.synyx.hades.dao.GenericDao;
import org.synyx.hades.dao.Param;
import org.synyx.hades.dao.Query;

import fr.appliClient.server.entity.Maintenance;

public interface MaintenanceDao extends GenericDao<Maintenance, Long> {

	@Query("FROM Maintenance m WHERE m.date = "
			+ "(select MAX(ma.date) from Maintenance ma WHERE ma.vehicle.registration = :registration)")
	public Maintenance getNext(@Param("registration") String vehicleId);

}
